@extends('layouts.art')

@section('content')
<a class="btn btn-primary" href="/art/create">添加文章</a>


@foreach( $arts as $art)
 <div class="panel panel-default">
  <div class="panel-body">
    {{$art->title}}
    <a href="/art/{{$art->id}}" class="btn btn-info">阅读</a>
    <a href="/art/{{$art->id}}/edit" class="btn btn-info">修改</a>

      <form action="/art/{{$art->id}}" method="post" style="display: inline-block;">
      		<!-- 防止CSRF攻击生成令牌 -->
      		{{csrf_field()}}
            <!-- <input type="hidden" name="_token" value="cDiYXYXv2ZBwe495qHESxS0eluEv34205ICSUgXv"> -->
            <!-- 生成html隐藏域 -->
            {{ method_field('DELETE') }}

            <!-- <input type="hidden" name="_method" value="DELETE"> -->
            <button type="submit" class="btn btn-danger">删除</button>
        </form>
    </div>
    </div>
   
 @endforeach

 {!!$arts->render() !!} 
 
     
 
  @endsection